<template>
  <div class="app">
    <h2 ref="title">我是App</h2>
    <button @click="showH2">点我输出上方的h2元素</button>
    <Hello ref="qwe"/>
  </div>
</template>

<script>
    import Hello from './components/Hello.vue'

    export default {
        name:'App',
        components:{Hello},
        methods: {
            showH2(){
                console.log(this.$refs.title)
                console.log(this.$refs.qwe)
            }
        },
    }
</script>

<style>
    .app {
        background-color: gray;
        padding: 20px;
    }
</style>